<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
         <link href="/TP/Public/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="/TP/Public/css/style.css"/>       
        <link href="/TP/Public/assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="/TP/Public/assets/css/ace.min.css" />
        <link rel="stylesheet" href="/TP/Public/font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="/TP/Public/js/jquery-2.1.3.min.js"></script>
        <script src="/TP/Public/assets/js/bootstrap.min.js"></script>
       <!--  <script type="text/javascript" src="/TP/Public/Widget/Validform/5.3.2/Validform.min.js"></script>
		<script src="/TP/Public/assets/js/typeahead-bs2.min.js"></script>           	
		<script src="/TP/Public/assets/js/jquery.dataTables.min.js"></script>
		<script src="/TP/Public/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="/TP/Public/assets/layer/layer.js" type="text/javascript" ></script>          
		<script src="/TP/Public/js/lrtk.js" type="text/javascript" ></script>
         <script src="/TP/Public/assets/layer/layer.js" type="text/javascript"></script>	
        <script src="/TP/Public/assets/laydate/laydate.js" type="text/javascript"></script> -->
<title>管理员</title>
</head>

<body>
<div class="page-content clearfix">
  <div class="administrator">
   <!-- 搜索栏？ -->
     <!--   <form class="form-inline">
        <div class="form-group">
          <input type="text" class="form-control" id="exampleInputName2" placeholder="请输入用户名">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
      </form> -->
      <div class="table_menu_list"  id="testIframe">
           <table class="table table-striped table-bordered table-hover" id="sample_table">
		<thead>
		 <tr>
				<!-- <th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th> -->
				<th width="80px">编号</th>
				<th width="100px">域名</th>
				<th width="200px">地址</th>
				<th width="120px">站长</th>
        <th width="100px">email</th>				
				<th width="180px">加入时间</th>
				<!-- <th width="70px">状态</th>                 -->
				<th width="200px">操作</th>
			</tr>
		</thead>
	<tbody>
    <?php if(is_array($list)): foreach($list as $key=>$val): ?><tr id="links_tr<?php echo ($val["id"]); ?>">
      <!-- <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td> -->
      <td><?php echo ($val["id"]); ?></td>
      <td><?php echo ($val["linkname"]); ?></td>
      <td><?php echo ($val["linkaddress"]); ?></td>
      <td><?php echo ($val["linkman"]); ?></td>
      <td ><?php echo ($val["email"]); ?></td>
      <td><?php echo ($val["addtime"]); ?></td>
   <!--    <td class="td-status"><span class="label label-success radius" id="state_s<?php echo ($val["id"]); ?>"><?php echo ($val["status"]); ?></span></td> -->
      <td class="td-manage">
        <a href="<?php echo U('Admin/Links/edit_links');?>?id=<?php echo ($val["id"]); ?>" class="btn btn-xs btn-success">修改</a> 
        <!-- <a title="编辑" onclick="" href="javascript:;"  class="btn btn-xs btn-info" ><i class="fa fa-edit bigger-120"></i></a>      -->  
       <a  href="javascript:;"  onclick="links_del(<?php echo ($val["id"]); ?>)" id="links_<?php echo ($val["id"]); ?>" class="btn btn-xs btn-warning" >删除</a>
       </td>
     </tr><?php endforeach; endif; ?>
    </tbody>
    </table>
        <div id="btnBox" align="right"><?php echo ($show); ?></div>
      </div>
     </div>
  </div>
</div>

</body>
</html>
<script type="text/javascript">
    $('#btnBox').children().children().unwrap().wrap('<li></li>').parent().wrapAll('<ul class="pagination"></ul>');
    // 给当前页码高亮显示
    $('#btnBox span').parent().addClass('active');
   //删除时调用
   function links_del(id){
      if(confirm('是否删除') == true){
          $.get("<?php echo U('Admin/Links/del_links');?>",{'id':id},function(data){
            if(data == '删除成功'){
                var state_s = '#links_tr'+id;
                $(state_s).remove();
            }else{
                alert(data);
            }
        });
      }    
   }















    // //点击修改时
    // function admin_start(id){
    //     if(status == 2){
    //         $.get("<?php echo U('Admin/Admin/up_admin');?>",{'id':id},function(data){
    //             if(data == '修改成功'){
    //                 var state_s = '#state_s'+id;
    //                 var state = '#state_'+id;
    //                 var comment = $(state).text();
    //                 // alert(comment);
    //                 if(comment == '禁用' || comment == '修改状态'){
    //                     $(state).text('启用');
    //                     $(state_s).text('禁用');
    //                 }else{
    //                     $(state).text('禁用');
    //                     $(state_s).text('启用');
    //                 }
    //             }else{
    //                 alert(data);
    //             }
    //         });
    //     }else{
    //         alert('无权限');
    //     }
    // }

    // function admin_del(id){
    //     if(status == 2){
    //       if(confirm('是否删除') == true){
    //           $.get("<?php echo U('Admin/Admin/del_admin');?>",{'id':id},function(data){
    //             if(data == '删除成功'){
    //                 var state_s = '#admin_tr'+id;
    //                 $(state_s).remove();
    //             }else{
    //                 alert(data);
    //             }
    //         });
    //       }
            
    //     }else{
    //         alert('无权限');
    //     }
    // }
</script>